package any.impl.util;

import java.util.Collection;
import java.util.Iterator;

//TODO: Better name!
public class NullArrayCollection<E> implements Collection<E> {

	private final int size;

	public NullArrayCollection(int size) throws IllegalArgumentException {
		if (size <= 0) throw new IllegalArgumentException("Invalid size: " + size);
		this.size = size;
	}
	
	public Object[] toArray() {
		return new Object[size];
	}
	
	public boolean add(E o) {
		throw new AssertionError("Should never be reached!");
	}
	public boolean addAll(Collection<? extends E> c) {
		throw new AssertionError("Should never be reached!");
	}
	public void clear() {
		throw new AssertionError("Should never be reached!");
	}
	public boolean contains(Object o) {
		throw new AssertionError("Should never be reached!");
	}
	public boolean containsAll(Collection<?> c) {
		throw new AssertionError("Should never be reached!");
	}
	public boolean isEmpty() {
		throw new AssertionError("Should never be reached!");
	}
	public Iterator<E> iterator() {
		throw new AssertionError("Should never be reached!");
	}
	public boolean remove(Object o) {
		throw new AssertionError("Should never be reached!");
	}
	public boolean removeAll(Collection<?> c) {
		throw new AssertionError("Should never be reached!");
	}
	public boolean retainAll(Collection<?> c) {
		throw new AssertionError("Should never be reached!");
	}
	public int size() {
		throw new AssertionError("Should never be reached!");
	}
	public <T> T[] toArray(T[] a) {
		throw new AssertionError("Should never be reached!");
	}
}
